<header class="main-header">
<!-- Logo -->
<a href="/admin/index/index.html" class="logo">
  <!-- mini logo for sidebar mini 50x50 pixels -->
  <span class="logo-mini">{{$sysname}}</span>
  <!-- logo for regular state and mobile devices -->
  <span class="logo-lg">{{$sysname}}</span>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top">
  <!-- Sidebar toggle button-->
  <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button" title="切换导航">
    <span class="sr-only">切换导航</span>
  </a>
  <!-- full screen -->
  <a href="javascript:;" class="sidebar-toggle fullscreen" title="全屏模式">
    <i class="glyphicon glyphicon-fullscreen"></i>
  </a>

  <div class="navbar-custom-menu">
    <ul class="nav navbar-nav">
      <!-- User Account: style can be found in dropdown.less -->
      <li class="dropdown user user-menu">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
          <img src="{{$headimg}}" class="user-image">
          <span class="hidden-xs">{{$username}}</span>
        </a>
        <ul class="dropdown-menu">
          <!-- User image -->
          <li class="user-header">
            <img src="{{$headimg}}" class="img-circle">
            <h5>上次登录时间：{{$last_time}}</h5>
            <h5>上次登录IP：{{$last_ip}}</h5>
          </li>
          <!-- Menu Body -->
          <!-- Menu Footer-->
          <li class="user-body">
            <div class="pull-left">
              <a href="{{:url('users/edit', ['id'=>$uid])}}" target="right" class="btn btn-default btn-flat">资料</a>
            </div>
            <div class="pull-right">
              <a href="{{:url('publics/logout')}}" class="btn btn-default btn-flat">退出</a>
            </div>
          </li>
        </ul>
      </li>
      <li>
          <a class="clear_cash" href="javascript:;"  target="right" title="清空缓存"><i class="glyphicon glyphicon-refresh"></i></a>
      </li>
      <li>
        <a href="/"  target="_blank" title="访问系统前台"><i class="glyphicon glyphicon-home"></i></a>
      </li>
    </ul>
  </div>
</nav>
</header>
<script>
  $(".clear_cash").click(function(){
      var url = "/admin/index/clear.html";
      swal({
          title: '确定要清除缓存吗?',
          text: "该操作无法撤回！",
          type: 'warning',
          showCancelButton: true,
          confirmButtonColor: '#3c8dbc',
          cancelButtonColor: '#d33',
          confirmButtonText: '确定',
          cancelButtonText: '取消'
      }).then(function(isConfirm) {
          if (isConfirm) {
              $.post(url,{del:true},function(result){
                  if(result.code == 1){
                      swal(result.msg,'','success').then(function(){window.location.reload()});
                  }else{
                      swal(result.msg,'','error');
                  }
              });
          }
      })
  })
</script>